<script>
	import {getCurrentInstance} from "vue";

  export default {
		onLaunch: function() {
      //导航栏高度
      uni.getSystemInfo({
        success: function (e) {
          // 获取 appContext  上下文
          const {appContext} = getCurrentInstance()
          console.log('StatusBar', appContext)
          // #ifndef MP
          appContext.config.globalProperties.StatusBar = e.statusBarHeight;
          if (e.platform == 'android') {
            appContext.config.globalProperties.CustomBar = e.statusBarHeight + 50;
          } else {
            appContext.config.globalProperties.CustomBar = e.statusBarHeight + 45;
          }
          // #endif
          // #ifdef MP-WEIXIN
          appContext.config.globalProperties.StatusBar = e.statusBarHeight;
          let custom = wx.getMenuButtonBoundingClientRect();
          appContext.config.globalProperties.Custom = custom;
          appContext.config.globalProperties.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
          // #endif
          // #ifdef MP-ALIPAY
          appContext.config.globalProperties.StatusBar = e.statusBarHeight;
          appContext.config.globalProperties.CustomBar = e.statusBarHeight + e.titleBarHeight;
          // #endif
        }
      })
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>


<style lang="scss">
	@import "colorui/main.css";
	@import "colorui/icon.css";
</style>
